1. Field of the Invention
The present invention generally relates to image processing apparatuses, image processing methods, recording media, and programs. More particularly, the invention relates to an image processing apparatus, an image processing method, a recording medium, and a program which are suitably used for decoding interframe prediction coded stream data.
2. Description of the Related Art
Moving Picture Experts Group2 (MPEG2) video is a high-efficiency coding method for video signals defined in International Standards Organization/International Electrotechnical Commission (ISO/IEC) 13818-2 and International Telecommunication Union-Telecommunication Sector (ITU-T) H.262 recommendations.
In MPEG, the coding efficiency is enhanced by determining motion-compensated differences between adjacent pixels by considering temporal redundancy of images. In an MPEG video decoder, concerning motion-compensated pixels, motion compensation is performed on a subject pixel which is currently decoded by adding reference picture data represented by the motion vector of the subject pixel to the subject pixel so that image data before being coded can be reconstructed.
An MPEG2 video stream has a hierarchical structure formed of layers, such as a sequence layer, a group-of-picture (GOP) layer, a picture layer, a slice layer, a macroblock layer, and a block layer.
A GOP includes a plurality of pictures. In MPEG2, an image is formed of three types of pictures, I-pictures (intra-coded pictures), P-pictures (predictive-coded pictures), and B-pictures (bidirectionally predictive-coded pictures). In I-pictures, all macroblocks are intra-coded (intraframe coding). P-pictures include intra-coded or inter-coded (forward (temporally preceding) interframe coded) macroblocks. B-pictures include intra-coded macroblocks, forward inter-coded macroblocks, backward (temporally upcoming) inter-coded macroblocks, or macroblocks subjected to interpolative interframe prediction coding performed by round-averaging forward inter-coded pixels and backward inter-coded pixels. Only I-pictures can be coded independently without reference to other pictures. Accordingly, operations that disturb chronological order of pictures, such as random access operations, can be easily implemented by accessing I-pictures.
The range of a GOP is from the GOP header to immediately before the next sequence header or the next GOP header. In a bit stream, the GOP header is inserted only immediately before an I-picture. Generally, since B-pictures are decoded by using bidirectional prediction, they are decoded with reference to preceding and upcoming I-pictures or P-pictures. If I-pictures or P-pictures referred to by a B-picture are located over adjacent GOPs, a GOP including such a B-picture is referred to as an “open GOP”. If an open GOP is decoded singly, it is possible that some B-pictures are not decoded.
It is not always necessary, however, to perform bidirectional prediction coding on B-pictures, and the coding mode can be switched for each macroblock between bidirectional prediction, only forward prediction, only backward prediction, or without prediction. A GOP that can be decoded with reference to I-pictures or P-pictures within the same GOP is referred to as a “closed GOP”. Closed GOPs can be decoded singly without preceding or upcoming GOPs.
The following technique is known. When playing back a video signal coded with a coding method for coding only a restricted number of frames at a rate of, for example, ×2 or ×3, a reproduced image presents natural motions (for example, the technique disclosed in U.S. Pat. No. 3,564,745).